<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  禁止右键菜单哦
  禁止选中文字
</body>
<script>
  // 1.禁止右键菜单
  document.addEventListener("contextmenu", (e) => {
    e.preventDefault();
  });
  // 2.禁止选中文字
  document.addEventListener("selectstart", (e) => {
    e.preventDefault();
  });
</script>

</html>